package com.young.weixin.model.message;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.young.weixin.model.enums.EWxMessageTypeEnum;

/**
 * 小视频消息
 *
 * @author wangjiyu
 * @date 2021/10/5 17:05
 */
@XStreamAlias("xml")
public class WxShortVideoMessage extends WxBaseMessage {
    /**
     * 视频消息缩略图的媒体id，可以调用多媒体文件下载接口拉取数据
     */
    @XStreamAlias("ThumbMediaId")
    private String thumbMediaId;
    /**
     * 媒体id
     */
    @XStreamAlias("MediaId")
    private String mediaId;

    /**
     * 构造消息对象
     *
     * @param fromUser 发送人
     * @param toUser   接收人
     * @return 消息对象
     */
    @Override
    public WxShortVideoMessage build(String fromUser, String toUser) {
        WxShortVideoMessage message = new WxShortVideoMessage();
        message.fillWxBaseMessage(fromUser, toUser, EWxMessageTypeEnum.SHORT_VIDEO);
        return message;
    }

    /**
     * 构造消息对象
     *
     * @param messageMapWrapper 参数map
     * @return 消息对象
     */
    @Override
    public WxShortVideoMessage convert(WxMessageMapWrapper messageMapWrapper) {
        WxShortVideoMessage message = new WxShortVideoMessage();
        message.fillWxBaseMessage(messageMapWrapper);
        message.setThumbMediaId(messageMapWrapper.getThumbMediaId());
        message.setMediaId(messageMapWrapper.getMediaId());
        return message;
    }

    public WxShortVideoMessage() {
        super();
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }
}
